home *** CD-ROM | disk | FTP | other *** search
/ Software Vault: The Gold Collection / Software Vault - The Gold Collection (American Databankers) (1993).ISO / cdr11 / pdox693.zip / TI1063.ASC < prev    next >
Text File  |  1993-05-12  |  9KB  |  331 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.   PRODUCT  :  Paradox for DOS, Paradox for Windows  NUMBER  :  1063
  9.   VERSION  :  All
  10.        OS  :  DOS,WIN
  11.      DATE  :  May 12, 1993                             PAGE  :  1/5
  12.  
  13.     TITLE  :  Paradox Table and Directory Locks
  14.  
  15.  
  16.  
  17.  
  18.   Intended Audience:
  19.   Paradox network users
  20.  
  21.   Prerequisites:
  22.   A basic understanding of network and DOS rights, and multi-table
  23.   forms.
  24.  
  25.   Purpose:
  26.   An explanation of Paradox table locks, and how they interact with
  27.   each other.
  28.  
  29.   Suggested Reading:
  30.   Technical Information Sheet #1246, Paradox Table Formats and
  31.        Network Locking Protocols
  32.   Technical Information Sheet #1109, Record Locks on a Network in
  33.        Paradox 4.0
  34.   Paradox 3.5 or earlier: Chapter 2 of the User's Guide
  35.   Paradox 4.0: Chapter 21 of the User's Guide
  36.   Paradox for Windows: Chapter 3 of the User's Guide
  37.  
  38.  
  39.   When Paradox is running on a network, it allows you to share
  40.   tables with other users.  However, not all operations can occur
  41.   simultaneously, so Paradox will lock tables to make sure that it
  42.   can complete operations with no interruptions from other users.
  43.   Normally, Paradox will implicitly lock tables as you do your
  44.   work.  Sometimes, though, you may want to lock tables explicitly
  45.   to ensure that you have access to them.
  46.  
  47.   Paradox for Windows uses the same locking mechanism of Paradox
  48.   4.0, so all the information here applies to both.  There is a
  49.   section at the end which explains the equivalencies between the
  50.   two versions.
  51.  
  52.   Let's start with the basic table locks that have existed since
  53.   Paradox 2.0:
  54.  
  55.   PFL    Prevent Full Lock -- guarantees that you will be able to
  56.          access (view/read) a table.
  57.  
  58.   PWL    Prevent Write Lock -- guarantees that you will be able to
  59.          change the data in a table
  60.  
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.  
  71.  
  72.  
  73.  
  74.   PRODUCT  :  Paradox for DOS, Paradox for Windows  NUMBER  :  1063
  75.   VERSION  :  All
  76.        OS  :  DOS,WIN
  77.      DATE  :  May 12, 1993                             PAGE  :  2/5
  78.  
  79.     TITLE  :  Paradox Table and Directory Locks
  80.  
  81.  
  82.  
  83.  
  84.   WL     Write Lock -- prevents other users from modifying the data
  85.          in a table.
  86.  
  87.   FL     Full Lock -- prevents other users from accessing a table.
  88.  
  89.   In Paradox for DOS, locks can be set either with Tools | Net |
  90.   Lock or PreventLock, or with the PAL LOCK command.  The LOCK
  91.   command can be used for placing several locks simultaneously,
  92.   guaranteeing access to all tables before starting an operation.
  93.  
  94.   If you are the only person accessing a table, you can put any
  95.   combination of locks on it.  However, if someone else has already
  96.   locked a table, you may be prevented from locking it.  The
  97.   following table shows which locks you can place if another user
  98.   has already locked the table:
  99.  
  100.                                       Other User
  101.     YOU                     FL       WL        PWL        PFL
  102.   Full Lock
  103.   Write Lock                         X                     X
  104.   Prevent Write Lock                            X          X
  105.   Prevent Full Lock                  X          X          X
  106.  
  107.  
  108.   If you want to be the only user allowed to modify a table (while
  109.   still allowing other users to view the table), use a combination
  110.   of WL and PWL.
  111.  
  112.  
  113.  
  114.   Query locks
  115.  
  116.   In all versions of Paradox, queries involving INSERT, DELETE or
  117.   CHANGETO will always place a Full Lock at DO_IT!  The situation
  118.   for regular queries (this also applies to reports) is a bit more
  119.   complex:
  120.  
  121.   In Paradox 3.5 and earlier, a query places a Prevent Full Lock on
  122.   the table(s), which means that other users can still modify the
  123.   table in CoEdit or DataEntry modes.  Each time a change gets
  124.   posted, the query must restart, unless it has already read the
  125.   entire table.
  126.  
  127.  
  128.  
  129.  
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136.  
  137.  
  138.  
  139.  
  140.   PRODUCT  :  Paradox for DOS, Paradox for Windows  NUMBER  :  1063
  141.   VERSION  :  All
  142.        OS  :  DOS,WIN
  143.      DATE  :  May 12, 1993                             PAGE  :  3/5
  144.  
  145.     TITLE  :  Paradox Table and Directory Locks
  146.  
  147.  
  148.  
  149.  
  150.   This process of restarting is called a "clean query", because it
  151.   produces a consistent view of the data.  While this is usually
  152.   good, the query may take a long time to finish if the table is
  153.   being constantly updated.
  154.  
  155.   In Paradox 4.0 (and Paradox for Windows) you can choose between a
  156.   Restart query and a Continue query which does not restart.
  157.   Continue queries are also known as "dirty queries".  A Continue
  158.   query functions exactly the same as a query in Paradox 3.5
  159.   (including the PFL), except that it does not restart, so your
  160.   data may not be completely consistent.
  161.  
  162.   Restart queries function a bit differently in Paradox 4.0.  When
  163.   the query starts, it attempts to place a Query Write Lock on the
  164.   table(s).  If an explicit Prevent Write Lock has been placed by
  165.   another user (causing the QWL to fail), the Restart query
  166.   functions exactly the same as a Paradox 3.5 query.
  167.  
  168.   If the QWL succeeds, no other user can modify the table until
  169.   Paradox has finished reading it.
  170.  
  171.   The QWL is different from a regular Write Lock because it ignores
  172.   the implicit PWL placed by a record lock.  I.e., if other users
  173.   have records locked, the QWL will still succeed.  The QWL will
  174.   allow other users to finish coediting the current record, but
  175.   they will not be allowed to make any further modifications until
  176.   the QWL is released.
  177.  
  178.   The only way to guarantee that you can modify records is to place
  179.   an explicit PWL or to make sure that all other users do Continue
  180.   queries.
  181.  
  182.  
  183.  
  184.  
  185.  
  186.  
  187.  
  188.  
  189.  
  190.  
  191.  
  192.  
  193.  
  194.  
  195.  
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202.  
  203.  
  204.  
  205.  
  206.   PRODUCT  :  Paradox for DOS, Paradox for Windows  NUMBER  :  1063
  207.   VERSION  :  All
  208.        OS  :  DOS,WIN
  209.      DATE  :  May 12, 1993                             PAGE  :  4/5
  210.  
  211.     TITLE  :  Paradox Table and Directory Locks
  212.  
  213.  
  214.  
  215.  
  216.   Form Locks
  217.  
  218.   In Paradox 3.0 and Paradox 3.5, the ability to create multi-table
  219.   forms was added.  To support this feature, a new kind of Write
  220.   Lock was created, the Form Lock (Form Write Lock, or FWL).  The
  221.   FWL gets activated any time a user coedits a multi-table form
  222.   with a 1-1 or 1-M detail table.
  223.  
  224.   Once the FWL is activated, all other users see a WL unless they
  225.   use the same form as User A.
  226.  
  227.   Note that the FWL will not be placed if the master table is in
  228.   User A's private directory, or if none of the detail tables have
  229.   a 1-1 or 1-M relationship.
  230.  
  231.   Form Locks no longer exist in Paradox 4.0 or Paradox for Windows.
  232.   They have been replaced by the Group Lock, a form of record lock.
  233.   For more information, see Tech Info Sheet #1109.
  234.  
  235.  
  236.  
  237.   Directory Locks
  238.  
  239.   Paradox 4.0 introduced a completely new kind of lock, the
  240.   DirLock.  The DirLock is a "unique" lock because other users can
  241.   remove the DirLock.  Also, it is the only lock that will stay in
  242.   place even if you exit from Paradox.
  243.  
  244.   The effect of the DirLock is most similar to a write protected
  245.   table (Tools | More | Protect | Write-protect).  If you try to
  246.   access a table in a DirLocked directory, you will get the same
  247.   error messages (and error codes for PAL programmers) that a write
  248.   protected table produces.
  249.  
  250.   After you place a DirLock, you will not be allowed to make the
  251.   DirLock directory your working directory or private directory.
  252.  
  253.  
  254.  
  255.  
  256.  
  257.  
  258.  
  259.  
  260.  
  261.  
  262.  
  263.  
  264.  
  265.  
  266.  
  267.  
  268.  
  269.  
  270.  
  271.  
  272.   PRODUCT  :  Paradox for DOS, Paradox for Windows  NUMBER  :  1063
  273.   VERSION  :  All
  274.        OS  :  DOS,WIN
  275.      DATE  :  May 12, 1993                             PAGE  :  5/5
  276.  
  277.     TITLE  :  Paradox Table and Directory Locks
  278.  
  279.  
  280.  
  281.  
  282.   The primary reason for the DirLock is to create a permanent .LCK
  283.   file.  Normally, Paradox cannot access a read-only directory,
  284.   because it can't create the .LCK file needed to handle data-
  285.   sharing.  To make a directory read-only, you must first place a
  286.   DirLock in the directory, and then exit Paradox.  (The DirLock is
  287.   permanent until removed, so there will still be a .LCK file in
  288.   that directory.)  Now you can use your network software to mark
  289.   the directory as read-only.
  290.  
  291.   Note: Paradox 4.0 does allow you to mark individual files as
  292.   read-only.  You can use either the DOS ATTRIB command, or your
  293.   network software (e.g. Novell's FILER).
  294.  
  295.  
  296.  
  297.   Paradox for Windows
  298.  
  299.   The following list shows the locks available in Paradox for
  300.   Windows, and the equivalent lock(s) from Paradox 4.0:
  301.  
  302.     Windows                DOS
  303.  
  304.   Open Lock                PFL
  305.   Read Lock                WL
  306.   Write Lock               WL *and* PWL
  307.   Exclusive Lock           FL
  308.  
  309.   Note that Paradox for Windows does not have a direct equivalent
  310.   for the Paradox 4.0 Prevent Write Lock.  The only way to generate
  311.   a PWL in Paradox for Windows is to open up a TCursor and lock a
  312.   record, which creates an implicit PWL.
  313.  
  314.   In Paradox for Windows, you set locks interactively with File |
  315.   Multi-user | Set Locks.  From OPAL, Lock() can be used as a
  316.   procedure, or as a Table or TCursor method.
  317.  
  318.  
  319.   DISCLAIMER: You have the right to use this technical information
  320.   subject to the terms of the No-Nonsense License Statement that
  321.   you received with the Borland product to which this information
  322.   pertains.
  323.  
  324.  
  325.  
  326.  
  327.  
  328.  
  329.  
  330.  
  331.